import { request } from '@/utils'

export default {
  create: data => request.post('/system/role/create', data),
  read: (params = {}) => request.get('/system/role/index', { params }),
  update: data => request.put(`/system/role/update/${data.id}`, data),
  delete: id => request.delete(`/system/role/delete/${id}`),

  getRolePermissions: (params = {}) => request.get(`/system/role/getMenuByRole/${params.id}`, { params }),
  updateRoleMenu: data => request.post(`/system/role/menuPermission/${data.role_id}`, data),
}
